To Apply Compression to JSON Response Files
You can apply
compression to IIS to greatly reduce the size of JSON response files, and thus
improve performance.
Follow these steps to compress JSON response files for IIS.
- On the ALIM Web Server, locate the application.Host.config file.
-
Replace the
httpCompression section with the following
text:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/json" enabled="true" /> <add mimeType="application/json; charset=utf-8" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/x-javascript; charset=utf-8" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/x-javascript; charset=utf-8" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression>
- When you are finished, save and exit application.Host.config.
- In Windows Features, expand Internet Information Services, then World Wide Web Services, then Performance Features, and then select Dynamic Content Compression For example,
- In the IIS Manager, navigate to the Server page, and then double-click to open the Configuration Editor.
- In the Section list, expand system.webServer, then webdav, and then select httpCompression.
-
Select dynamicTypes and then click the ellipse button (
).
The list editor opens.
- Ensure that application/javascript and application/json appear, and enabled status is set to "true". For example,
- When finished, close the editor, click Apply.
- Restart IIS Manager to load the new module.